package com.usabb.enums;

import com.alibaba.druid.util.StringUtils;
import com.usabb.domain.AmenityDO;
import com.usabb.domain.AttachDO;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;


/**
 * 图片管理 业务类型
 */
@AllArgsConstructor
@Getter
public enum AttachImageTypeEnum {

    LIST("列表"),
    REAL("实景"),
    AVATAR("头像"),
    WECHAT_QRCODE("微信二维码"),
    //add here


    OTHERS("其他");

    private String desc;

    public static boolean isListType(AttachDO input) {
        return !Objects.isNull(input) && StringUtils.equalsIgnoreCase(LIST.name(), input.getImageType());
    }

    public static boolean isReal(AttachDO input) {
        return !Objects.isNull(input) && StringUtils.equalsIgnoreCase(REAL.name(), input.getImageType());
    }

    public static boolean isAvatar(AttachDO input) {
        return !Objects.isNull(input) && StringUtils.equalsIgnoreCase(AVATAR.name(), input.getImageType());
    }

    public static boolean isWechatQrCode(AttachDO input) {
        return !Objects.isNull(input) && StringUtils.equalsIgnoreCase(WECHAT_QRCODE.name(), input.getImageType());
    }


}
